import request from '@/utils/request/req';

// 获取朋友圈首页
export function getMomentsHome(wxId: string) {
  return request({
    url: '/msg/moments/home',
    method: 'post',
    data: { wxId }
  });
}

// 获取朋友圈下一页
export function getMomentsNextPage(wxId: string, lastId: string) {
  return request({
    url: '/msg/moments/nextPage',
    method: 'post',
    data: { wxId, lastId }
  });
}

// 朋友圈点赞/取消点赞
export function toggleMomentsLike(momentsId: string, state: '1' | '0', wxId: string) {
  return request({
    url: '/msg/moments/like',
    method: 'post',
    data: { momentsId, state, wxId }
  });
}

// 朋友圈评论
export function addMomentsComment(momentsId: string, content: string, wxId: string) {
  return request({
    url: '/msg/moments/comment',
    method: 'post',
    data: { momentsId, content, wxId }
  });
}

// 朋友圈删除评论
export function deleteMomentsComment(momentsId: string, commentId: string, wxId: string) {
  return request({
    url: '/msg/moments/deleteComment',
    method: 'post',
    data: { momentsId, commentId, wxId }
  });
}

// 获取指定好友的朋友圈首页
export function getFriendMomentsHome(wxId: string, currentWxId: string) {
  return request({
    url: '/msg/moments/friend/home',
    method: 'post',
    data: { wxId, currentWxId }
  });
}

// 获取指定好友的朋友圈下一页
export function getFriendMomentsNextPage(wxId: string, lastId: string, currentWxId: string) {
  return request({
    url: '/msg/moments/friend/nextPage',
    method: 'post',
    data: { wxId, lastId, currentWxId }
  });
}
